package com.dwms.controller;

import com.dwms.entity.Result;
import com.dwms.feign.system.CacheFeignClient;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName: CacheController
 * @Description: Cache
 * @Create 2022/03/05 20:46
 * @Author WH
 * @Since 2.0.0
**/
@Tag(name = "缓存管理")
@RestController(value = "CacheController")
@RequestMapping(value = "/system/cache")
@RequiredArgsConstructor
public class CacheController {

    private final CacheFeignClient cacheFeignClient;

    @Operation(summary = "刷新缓存")
    @PostMapping("/flushCache")
    public Result flushCache() {
        return cacheFeignClient.flushCache();
    }
}
